<?php

class CIOrg extends dbObject {
	public $org_id;
	
	/*
	 * The org:* 'table' is a set that contains the user IDs of all of the users in that org.
	 */
	
	public function __construct($org_id) {
		$this->dbTable = 'org';
		$this->tableKey = 'org_id';
		$this->keyType = 'set';
				
		$this->org_id = $org_id;
	}
	
	public function addUser($user_id) {
		$this->members[] = $user_id;
		$this->insert();
	}
	
	public static function getUsers($org_id) {
		$org = new CIOrg($org_id);
		$org->find($org->org_id);
		return $org->members;
	}
}

?>